﻿using System;
using System.Web;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System.Collections;
using System.Data;
using System.Data.Sql;
using System.Data.SqlClient;

using com.fly.sms;

namespace com.fly.sms
{
    public class SearchSendSmsLogAction:BaseAction
    {
        public SearchSendSmsLogAction(HttpContext contextTemp)
        {
            this.context = contextTemp;
        }
        public override void excute()
        {
            //发送状态
            string State = context.Request["State"];
            //时间范围
            string StartTime = context.Request["StartTime"];
            string EndTime = context.Request["EndTime"];
            //标识名称关键字
            string Name = context.Request["Name"];

            DataTable rst = null;
            if (State == "sending")
            {
                rst = SMSendService.find(CustomerId,StartTime, EndTime, Name, startRow, pagePerSize);
            }
            else {
                rst = SMSendHistoryService.find(CustomerId,StartTime, EndTime, Name, startRow, pagePerSize);                
            }
            ht.Add("responseCode", "200");
            ht.Add("responseData", rst);
            string json = JsonConvert.SerializeObject(ht);
            context.Response.Write(json);           
        }
    }
}